package com.tinglv.imguider.provider.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.tinglv.imguider.dao.AdminDao;
import com.tinglv.imguider.entity.Admin;
import com.tinglv.imguider.service.AdminService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 管理员业务接口实现层
 *
 * @author hochen
 * @date 2017/11/27 0027.
 */
@Component @Service(interfaceClass = AdminService.class) public class AdminServiceImpl
    implements AdminService {

    private static final Logger log = LoggerFactory.getLogger(AdminServiceImpl.class);
    @Autowired AdminDao adminDao;

    @Override public Admin findByName(String name) {
        try {
            return adminDao.findByName("%" + name + "%");
        } catch (Exception e) {
            log.info("[异常{}]", e);
        }
        return null;
    }

}
